home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 25 / AMIGAplus Sonderheft 25 (2000)(Falke)(DE)(Track 1 of 4)[!].iso / PublicDomain / Spiele / GalagawarsV1_5 / GWars / InterleavedShapeShunter.asc < prev    next >
Text File  |  1999-11-13  |  2KB  |  86 lines

  1. ; Shapeshunter 2000
  2. ; By Wiremu TeKani July 1999
  3. ; converts normal shape into inmap (interleaved bitmap) format
  4.  
  5. ; An inmap is an optimised way of blitting graphics. Generally,
  6. ; if you have a 5 bitplane bitmap it means the computer has to
  7. ; access the blitter 5 times, and it won't let you use the CPU
  8. ; until the final bitplane has been blitted.
  9.  
  10. ; An inmap mushes all those bitplanes together, making it a
  11. ; ONE bitplane bitmap that is 5 times the height. With some
  12. ; bitmap display trickery, they can be displayed just like
  13. ; a conventional shape.
  14.  
  15. ; Contact me at:
  16. ; tekani@yahoo.com
  17. ; wtekani@netscape.net
  18.  
  19.  
  20. ; Initialisation
  21.  
  22. #dept=5
  23. Sh$="Stl:Gwars/allshapes"
  24. #lastshp=110
  25.  
  26. BitMap 0,320,256,#dept
  27. ;For a=1 To #dept
  28.  
  29. BitPlanesBitMap 0,1,1
  30. BitPlanesBitMap 0,2,2
  31. BitPlanesBitMap 0,3,4
  32. BitPlanesBitMap 0,4,8
  33. BitPlanesBitMap 0,5,16
  34.  
  35. ;next a
  36. InitBank 0,40*256*#dept,$10002             ; Get some free CHIP memory.
  37. CludgeBitMap 9,320,256*#dept,1,Bank(0) ; And make it a planar bitmap.
  38.  
  39. ; Load shapes here
  40.  
  41. LoadShapes 0,Sh$
  42.  
  43. ; Display macro
  44.  
  45. InitCopList 0,44,256,$13011,8,2,0
  46. BLITZ
  47. CreateDisplay 0
  48. DisplayBitMap 0,3
  49.  
  50. ; Interleave shapes
  51.  
  52. BitMapOutput 9
  53.  
  54. For shp=0 To #lastshp
  55.   Use BitMap 0
  56.   Cls 0
  57.  If shp<>43
  58.   sw=ShapeWidth(shp)
  59.   sh=ShapeHeight(shp)
  60.   Blit shp,0,0
  61.   For a=1 To #dept
  62.     For y=0 To sh
  63.       Use BitMap a
  64.       GetaShape 150,0,y,sw,1
  65.       Use BitMap 9
  66.       Block 150,0,(y*#dept)+(a-1)
  67.     Next y
  68.   Next a
  69.   GetaShape shp,0,0,sw,sh*#dept
  70.   Locate 0,0:Print Str$(shp)
  71.  EndIf
  72.  
  73. DisplayBitMap 0,9,0,0
  74.   VWait
  75.   Use BitMap 9
  76.   Cls 0
  77. Next shp
  78.  
  79. QAMIGA
  80. VWait 150
  81.  
  82. SaveShapes 0,#lastshp,Sh$+".int"
  83.  
  84. MouseWait
  85.  
  86.